package ru.cod.rs.main.views;

import ru.cod.rs.main.managers.GameManager;
import android.content.Context;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class GameView extends SurfaceView implements SurfaceHolder.Callback {

	GameManager manager;

	public GameView(Context context) {
		super(context);
		getHolder().addCallback(this);
	}

	// //////////////////////////////////////////
	//
	// public void resume() {
	// manager = new GameManager(getContext(), this);
	// manager.go();
	// manager.start();
	//
	// }
	//
	// public void suicide() {
	// manager.suicide();
	// manager = null;
	// }

	// ///////////////////////////////////////////////////
	@Override
	public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {

	}

	@Override
	public void surfaceCreated(SurfaceHolder arg0) {
		manager = new GameManager(getContext(), this);
		manager.go();
		manager.start();
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder arg0) {
		manager.suicide();
		manager = null;

	}
}
